import os
import pygame
from config import uiconfig
from ui import window, src
from tools import *
screen = None
frames = 0


def render_loading(render_screen):
    global screen, frames
    screen = render_screen
    frames = (frames+1) % 120
    if frames < 60:
        pygame.draw.polygon(screen, uiconfig.FONT_COLOR, [
                            (20+6, 600-40), (20+6+1.5*frames, 600-40), (20+1.5*frames, 600-20), (20, 600-20)], 0)
    else:
        pygame.draw.polygon(screen, uiconfig.FONT_COLOR, [
                            (20+6+1.5*(frames-60), 600-40), (20+6+1.5*60, 600-40), (20+1.5*60, 600-20), (20+1.5*(frames-60), 600-20)], 0)
